<?php echo $this->fetch('header.html'); ?>
<?php echo $this->fetch('cyitem/nav.html'); ?>
<div class="search-form">
<form method="get" action="<?php echo $this->_var['appadmin']; ?>">
<input type="hidden" name="m" value="cyitem" />

ID:<input type="text" name="id" value="<?php echo intval($_GET['id']); ?>" class="w50" />
状态：<select name="status" class="w100">
	<option value="0">选择</option>
	<option value="1" <?php if (get ( 'status' ) == 1): ?>selected="selected"<?php endif; ?>>未审核</option>
    <option value="2" <?php if (get ( 'status' ) == 2): ?>selected="selected"<?php endif; ?>>已审核</option>
    <option value="3" <?php if (get ( 'status' ) == 3): ?>selected="selected"<?php endif; ?>>重新提交</option>
    <option value="98" <?php if (get ( 'status' ) == 98): ?>selected="selected"<?php endif; ?>>已禁止</option>
</select>
分类：    <select name="catid" class="w100">
    <option value="0">请选择</option>
    <?php $_from = $this->_var['cat_list']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
                <option value="<?php echo $this->_var['c']['catid']; ?>" <?php if (get ( 'catid' ) == $this->_var['c']['catid']): ?> selected="selected"<?php endif; ?>><?php echo $this->_var['c']['cname']; ?></option>
                <?php $_from = $this->_var['c']['child']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c_2');if (count($_from)):
    foreach ($_from AS $this->_var['c_2']):
?>
                	<option value="<?php echo $this->_var['c_2']['catid']; ?>" <?php if (get ( 'catid' ) == $this->_var['c_2']['catid']): ?> selected="selected"<?php endif; ?> class="o_c_2">|__<?php echo $this->_var['c_2']['cname']; ?></option>
                    <?php $_from = $this->_var['c_2']['child']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c_3');if (count($_from)):
    foreach ($_from AS $this->_var['c_3']):
?>
                    <option value="<?php echo $this->_var['c_3']['catid']; ?>" <?php if (get ( 'catid' ) == $this->_var['c_3']['catid']): ?> selected="selected"<?php endif; ?> class="o_c_3"> |____<?php echo $this->_var['c_3']['cname']; ?></option>
                    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </select>
主题：<input type="text" name="title" value="<?php echo $_GET['title']; ?>" class="w200" />
推荐：<select name="s_recommend" class="w100">
<option value="0">请选择</option>
<option value="1" <?php if (get ( 's_recommend' ) == 1): ?> selected="selected"<?php endif; ?>>是</option>
<option value="2" <?php if (get ( 's_recommend' ) == 2): ?> selected="selected"<?php endif; ?>>否</option>
</select>
图片：<select name="s_is_img" class="w100">
<option value="0">请选择</option>
<option value="1" <?php if (get ( 's_is_img' ) == 1): ?> selected="selected"<?php endif; ?>>有</option>
<option value="2" <?php if (get ( 's_is_img' ) == 2): ?> selected="selected"<?php endif; ?>>无</option>
</select>
<input type="submit" value="搜索" class="btn" />
</form>
</div>
<div class="rbox">
<form method="post" action="<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=category">
<table width="100%"  class="table table-bordered">
  <tr>
    <td width="4%" align="center">id <input type="checkbox" id="chkall"  /></td>
    <td width="18%" align="center">标题</td>
    <td width="7%" align="center">分类</td>
    <td width="7%" align="center">作者</td>
    <td width="6%">发起人</td>
    <td width="8%">电话</td>
    <td width="11%" align="center">时间</td>
    <td width="5%" align="center">审核</td>
    <td width="5%">推荐</td>
    <td width="5%">最新</td>
    <td width="5%">最热</td>
    <td width="13%" align="center">操作</td>
  </tr>
  <?php $_from = $this->_var['data']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
  <tr>
    <td align="center"><input type="checkbox" class="ids"  name="ids[]" value="<?php echo $this->_var['c']['id']; ?>" /> <?php echo $this->_var['c']['id']; ?></td>
    <td align="center"><?php echo $this->_var['c']['title']; ?> <?php if ($this->_var['c']['imgurl']): ?><img src="<?php echo images_site($this->_var['c']['imgurl']); ?>.100x100.jpg" style="width:50px" /><?php endif; ?></td>
    <td align="center"><a href="<?php echo R("/index.php?m=list&catid=".$this->_var["c"]["catid"]."");?>" target="_blank"><?php echo $this->_var['c']['cname']; ?><?php if ($this->_var['c']['cname_2nd']): ?>><?php echo $this->_var['c']['cname_2nd']; ?><?php endif; ?><?php if ($this->_var['c']['cname_3nd']): ?>><?php echo $this->_var['c']['cname_3nd']; ?><?php endif; ?></a></td>
    <td align="center"><?php if ($this->_var['c']['nickname']): ?><?php echo $this->_var['c']['nickname']; ?><?php else: ?>管理员<?php endif; ?></td>
    <td width="6%"><?php echo $this->_var['c']['truename']; ?></td>
    <td width="8%"><?php echo $this->_var['c']['telephone']; ?></td>
    <td align="center"><?php echo date("Y-m-d",$this->_var['c']['dateline']); ?></td>
    <td align="center"> 
    <?php if ($this->_var['c']['status'] == 2): ?>
   <img src='<?php echo $this->_var['skins']; ?>images/yes.gif' class="ajax_no" url='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=status&id=<?php echo $this->_var['c']['id']; ?>&status=98' rurl='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=status&id=<?php echo $this->_var['c']['id']; ?>&status=2'>
    <?php else: ?>
    <img src='<?php echo $this->_var['skins']; ?>images/no.gif' class="ajax_yes" url='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=status&id=<?php echo $this->_var['c']['id']; ?>&status=2' rurl='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=status&id=<?php echo $this->_var['c']['id']; ?>&status=98'>
    <?php endif; ?></td>
    <td><?php if ($this->_var['c']['is_recommend'] == 1): ?>
   <img src='<?php echo $this->_var['skins']; ?>images/yes.gif' class="ajax_no" url='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=recommend&id=<?php echo $this->_var['c']['id']; ?>&is_recommend=0' rurl='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=recommend&id=<?php echo $this->_var['c']['id']; ?>&is_recommend=2'>
    <?php else: ?>
    <img src='<?php echo $this->_var['skins']; ?>images/no.gif' class="ajax_yes" url='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=recommend&id=<?php echo $this->_var['c']['id']; ?>&is_recommend=1' rurl='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=recommend&id=<?php echo $this->_var['c']['id']; ?>&is_recommend=0'>
    <?php endif; ?></td>
    
    <td><?php if ($this->_var['c']['isnew'] == 1): ?>
   <img src='<?php echo $this->_var['skins']; ?>images/yes.gif' class="ajax_no" url='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=new&id=<?php echo $this->_var['c']['id']; ?>&isnew=0' rurl='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=new&id=<?php echo $this->_var['c']['id']; ?>&isnew=1'>
    <?php else: ?>
    <img src='<?php echo $this->_var['skins']; ?>images/no.gif' class="ajax_yes" url='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=new&id=<?php echo $this->_var['c']['id']; ?>&isnew=1' rurl='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=new&id=<?php echo $this->_var['c']['id']; ?>&isnew=0'>
    <?php endif; ?></td>
    
    <td><?php if ($this->_var['c']['ishot'] == 1): ?>
   <img src='<?php echo $this->_var['skins']; ?>images/yes.gif' class="ajax_no" url='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=hot&id=<?php echo $this->_var['c']['id']; ?>&ishot=0' rurl='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=hot&id=<?php echo $this->_var['c']['id']; ?>&ishot=1'>
    <?php else: ?>
    <img src='<?php echo $this->_var['skins']; ?>images/no.gif' class="ajax_yes" url='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=hot&id=<?php echo $this->_var['c']['id']; ?>&ishot=1' rurl='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=hot&id=<?php echo $this->_var['c']['id']; ?>&ishot=0'>
    <?php endif; ?></td>
    
    <td align="center"><a href="index.php?m=show&id=<?php echo $this->_var['c']['id']; ?>" target="_blank">查看</a>  <a href='<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=add&id=<?php echo $this->_var['c']['id']; ?>'>编辑</a> <a href="javascript:;" class="del" url="<?php echo $this->_var['appadmin']; ?>?m=cyitem&a=delete&id=<?php echo $this->_var['c']['id']; ?>">删除</a></td>
  </tr>
  <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
 
</table>
<div style="padding:10px;">
	分类：    <select name="catid" class="w100">
    <option value="0">请选择</option>
    <?php $_from = $this->_var['cat_list']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c');if (count($_from)):
    foreach ($_from AS $this->_var['c']):
?>
                <option value="<?php echo $this->_var['c']['catid']; ?>" <?php if (get ( 'catid' ) == $this->_var['c']['catid']): ?> selected="selected"<?php endif; ?>><?php echo $this->_var['c']['cname']; ?></option>
                <?php $_from = $this->_var['c']['child']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c_2');if (count($_from)):
    foreach ($_from AS $this->_var['c_2']):
?>
                	<option value="<?php echo $this->_var['c_2']['catid']; ?>" <?php if (get ( 'catid' ) == $this->_var['c_2']['catid']): ?> selected="selected"<?php endif; ?> class="o_c_2">|__<?php echo $this->_var['c_2']['cname']; ?></option>
                    <?php $_from = $this->_var['c_2']['child']; if (!is_array($_from) && !is_object($_from)) { $_from=array();}; $this->push_vars('', 'c_3');if (count($_from)):
    foreach ($_from AS $this->_var['c_3']):
?>
                    <option value="<?php echo $this->_var['c_3']['catid']; ?>" <?php if (get ( 'catid' ) == $this->_var['c_3']['catid']): ?> selected="selected"<?php endif; ?> class="o_c_3"> |____<?php echo $this->_var['c_3']['cname']; ?></option>
                    <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
                <?php endforeach; endif; unset($_from); ?><?php $this->pop_vars();; ?>
    </select>
    
    <input type="submit" class="btn" value="修改分类" />
</div>
</form>
<?php echo $this->_var['pagelist']; ?>
</div>
<script>
$("#chkall").click(function(){
	if($(this).attr("checked")=="checked"){
		$(".ids").attr("checked",true);
	}else{
		$(".ids").attr("checked",false);
	}
});
</script>
<?php echo $this->fetch('footer.html'); ?>